package cn.bnjy.common;

/**
 * 描述：微信api
 *
 * @date: 2018/11/3 14:26
 * @author: chavin
 */
public class WeiXinApi {

    /**
     * 获取access_token，get
     */
    public static final String ACCESS_TOKEN = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=APPID&secret=APPSECRET";

    /**
     * 删除菜单，http请求方式：GET
     */
    public static final String DELETE_MENU = "https://api.weixin.qq.com/cgi-bin/menu/delete?access_token=ACCESS_TOKEN";

    /**
     * 插入菜单，http请求方式：POST（请使用https协议）
     */
    public static final String CREATE_MENU = "https://api.weixin.qq.com/cgi-bin/menu/create?access_token=ACCESS_TOKEN";

    /**
     * 获取用户基本信息（包括UnionID机制），http请求方式：GET
     */
    public static final String USER_INFO = "https://api.weixin.qq.com/cgi-bin/user/info?access_token=ACCESS_TOKEN&openid=OPENID&lang=zh_CN";

    /**
     * 批量获取用户基本信息（每次最多100条），http请求方式：POST
     */
    public static final String USER_INFO_BATCH = "https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token=ACCESS_TOKEN";

    /**
     * 添加客服帐号，每个公众号最多添加10个客服账号，http请求方式: POST
     */
    public static final String ADD_KF_ACCOUNT = "https://api.weixin.qq.com/customservice/kfaccount/add?access_token=ACCESS_TOKEN";

    /**
     * 客服向用户发送消息
     */
    public static final String KF_SENDMSG = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=ACCESS_TOKEN";

    /**
     * 创建临时二维码，获取ticket
     */
    public static final String GET_TEMP_QRCODE_TICKET = "https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=ACCESS_TOKEN";

    /**
     * HTTP GET请求（请使用https协议）
     */
    public static final String CREATE_TEMP_QRCODE = "https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=TICKET";

    /**
     * 上传临时素材
     */
    public static final String CURL_CREATE_TEMP_SOURCE = "curl -F media=@IMGPATH \"https://api.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE\"";

    /**
     * 微信网页授权获取用户信息（需用户手动点击同意授权，可以拿到用户详细的基本信息）
     */
    public static final String WEIXIN_WEB_SNSAPI_USERINFO_AUTH = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect";

    /**
     * 微信网页授权获取用户信息（静默授权，无需用户手动点击同意授权，只能获取用户openid）
     */
    public static final String WEIXIN_WEB_SNSAPI_BASE_AUTH = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=APPID&redirect_uri=REDIRECT_URI&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";

    /**
     * 微信网页授权通过code换取网页授权access_token
     */
    public static final String WEIXIN_WEB_OAUTH2_USER_INFO = "https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code";

}
